import {
  Toast
} from 'vant'

export default {
  //显示提示加载中 duration为 0 表示不会消失
  startLoading(params = {
    message: '加载中...',
    forbidClick: true,
    loadingType: 'spinner',
    duration: 0
  }) {
    Toast.loading(params);
  },
  //关闭提示
  closeLoading() {
    Toast.clear();
  },
  //失败提示
  fail(message = "", duration = 2000) {
    Toast.fail({
      message,
      duration
    });
  },
  //自定义提示
  customToast(params){
    Toast(params);
  },
}
